<?php

namespace app\admin\controller;

use think\Controller;

class Home extends Base
{
    //
    public function index()
    {
        $admin    = session('admin');
        $viewData = [
            'admin' => $admin
        ];
        $this->assign($viewData);
        return view();
    }

    public function main(){
        return view();
    }

    public function loginOut(){
        session(null);
        if (session('?admin.id')) {
            $this->error('退出失败！');
        } else {
            $this->success('退出成功', 'admin/index/login');
        }
    }
}
